home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / clip2iff60.rexx < prev    next >
OS/2 REXX Batch file  |  1996-04-23  |  2KB  |  91 lines

  1. /* Clip2IFF60.rexx V2.0 -- Export a clip as IIF Files */
  2. /* By Bob Caron © 1995 NewTek Inc.                    */
  3.  
  4. parse arg InClipName","OutClipName","StartFrame","EndFrame
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. IFFBaseName=OutClipName
  11. if endframe="" then do
  12.  'Askb'"Please select;A source clip."
  13.  exit
  14.  end
  15.  
  16. if ~show('l','rexxsupport.library') then do
  17.   if ~addlib('rexxsupport.library',0,-30,34) then do
  18.     exit
  19.   end
  20. end
  21.  
  22. dots=0
  23. XWin = 100
  24. YWin = 40
  25. Clear = d2c(12)
  26. nv = ''
  27. cr = '0a'x
  28. call getfontsize
  29.  
  30. wid = width*48
  31. hei = theight+height*10
  32.  
  33. if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/Clip2IFF60 Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  34.     exit
  35. end
  36.  
  37.  i=0
  38.  OutName=IFFBaseName||"."||i
  39.  do i = StartFrame to EndFrame
  40.         call OpenWindow(InclipName,OutName,i,EndFrame,i)
  41.         'Gnfd'                                                  /* Get Field and inc */
  42.         OutName=IFFBaseName||"."||i  /* Setup save name */
  43.         call OpenWindow(InclipName,OutName,i,EndFrame,i)
  44.         'Asav'OutName                                           /* Write out RGB */
  45.  end
  46. exit
  47.  
  48. OpenWindow:
  49. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  50.   pdots="...."
  51.   dots=dots+1
  52.   if dots>4 then dots=1
  53.   call writech('Window',Clear||nv||cr)
  54.   call writech('Window','Current Source Clip ['InClipName']'cr)
  55.   call writech('Window','  Current Dest IFF  ['OutClipName']'cr)
  56.   call writech('Window',''cr)
  57.   call writech('Window','Current Field: 'Frame''cr)
  58.   call writech('Window','    End Field: 'EndFrame''cr)
  59.   call writech('Window',''cr)
  60.   call writech('Window','Processing'right(pdots,dots)||cr)
  61.  
  62. return
  63.  
  64.  
  65. getfontsize:
  66.  
  67. if open('font','env:sys/font.prefs','R') then do
  68.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  69.    call close('font')
  70.    font = substr(font,index(font,'FONT')+4)
  71.    font = substr(font,index(font,'FONT')+4)
  72.    height = c2d(substr(font,29,2))
  73.    tfont = substr(font,index(font,'FONT')+4)
  74.    theight = c2d(substr(tfont,29,2))
  75.    font = substr(font,33)
  76.    font = left(font,index(font,d2c(0))-1-5)
  77.    if open('font','FONTS:'font'/'height,'R') then do
  78.       width = c2d(right(readch('font',116),2))
  79.       call close('font')
  80.   end
  81.   else if height=9 then width = 10
  82.                    else width = 8
  83. end
  84.   else do
  85.   theight = 8
  86.   height = 8
  87.   width = 8
  88. end
  89.  
  90. return
  91.